package HttpControl;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import Juego.principal;
import Juego.modelo.Usuario.beanUsuario;

public class HttpControl {
	    static String bd = "juegoLP2";
	    static String login = "root";
	    static String password = "";
	    static String url = "jdbc:mysql://localhost/"+bd;

	    Connection conn = null;

	    /** Constructor de DbConnection */
	    public HttpControl() throws SQLException {
	       try{
	          //obtenemos el driver de para mysql
	          Class.forName("com.mysql.jdbc.Driver");
	          //obtenemos la conexi�n
	          conn = DriverManager.getConnection(url,login,password);
	          if (conn!=null){
	             System.out.println("Conecci�n a base de datos "+bd+" OK");
	          }
	       }catch(Exception e){
	          System.out.println(e);
	       }
	    }
	    /**Permite retornar la conexi�n*/
	    public Connection getConnection(){
	       return conn;
	    }

	    public void desconectar(){
	       conn = null;
	    }	
	    public static void main(String[] args) {	
			try {
				HttpControl http = new HttpControl();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
}
